package com.autumn.common.api.application.dto;

import com.autumn.common.api.application.DataValidation;
import com.autumn.common.api.domain.entities.IEntity;
import com.autumn.validation.ValidationUtils;

/**
 * 实体Dto
 * 
 * @author 老码农
 *         <p>
 *         Description
 *         </p>
 * @date 2017-12-31 21:35:05
 * @param <TPrimaryKey> 主键类型
 */
public class EntityDto<TPrimaryKey> implements IEntity<TPrimaryKey>, DataValidation {

	/**
	 * 
	 */
	private static final long serialVersionUID = -984688656832255716L;
	private TPrimaryKey id;

	/**
	 * 获取Id
	 * 
	 * @return
	 */
	@Override
	public TPrimaryKey getId() {
		return id;
	}

	/**
	 * 设置Id
	 * 
	 * @param id id值
	 */
	@Override
	public void setId(TPrimaryKey id) {
		this.id = id;
	}

	/**
	 * 
	 */
	@Override
	public void valid() {
		ValidationUtils.validation(this);
	}
}
